package com.gjs.cd.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gjs.cd.pojo.dto.TotalReq;
import com.gjs.cd.pojo.entity.CdCodeActivationRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhongwenguang
 * @date 2022-3-21 15:38
 */
public interface ICdCodeActivationRecord extends IService<CdCodeActivationRecord> {
    List<TotalReq> getTotalByIds(String tableName, List<Long> batchIds);
    //查询激活记录
    List<CdCodeActivationRecord> codeCheckRecord(@Param("tableName") String tableName, @Param("id") Long id);

    //添加记录
    Integer addRecord(@Param("tableName") String tableName,CdCodeActivationRecord cdCodeActivationRecord);

    //检查该用户、该设备Mac、该激活码是否已经激活过
    CdCodeActivationRecord checkRecord(@Param("tableName") String tableName,@Param("record") CdCodeActivationRecord record);

    //获取所有激活记录表名
    List<String> queryTable();

    //按表名查询并合并结果
    List<CdCodeActivationRecord> queryByTableNames(@Param("list") List<String> list,@Param("record")CdCodeActivationRecord record);

    //查询激活记录
    List<CdCodeActivationRecord> queryAllRecord(@Param("tableName")String tableName,@Param("userSn")String userSn,@Param("deviceMac")String deviceMac);

    //获取用户的激活记录
    List<Long> queryUserRecord(@Param("tableName")String tableName,@Param("userSn")String userSn);
}
